package com.ma.gulimall.order.controller;

import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName RabbitController
 * @Author: mayongqiang
 * @DATE 2021/10/31 22:28
 * @Description:
 */
@RestController
public class RabbitController {

    //@Autowired
    //RabbitTemplate rabbitTemplate;
    //
    //@GetMapping("/sendMq")
    //public String sendMq(@RequestParam(value = "num", defaultValue = "10") Integer num) {
    //    for (int i = 0; i < num; i++) {
    //        if (i % 2 == 0) {
    //            OrderReturnReasonEntity reasonEntity = new OrderReturnReasonEntity();
    //            reasonEntity.setId(1L);
    //            reasonEntity.setName("哈哈" + i);
    //            reasonEntity.setCreateTime(new Date());
    //            rabbitTemplate.convertAndSend("hello-java-exchange", "hello-java", reasonEntity, new CorrelationData(UUID.randomUUID().toString()));
    //
    //        } else {
    //            OrderEntity orderEntity = new OrderEntity();
    //            orderEntity.setOrderSn(UUID.randomUUID().toString());
    //            rabbitTemplate.convertAndSend("hello-java-exchange", "hello-java", orderEntity, new CorrelationData(UUID.randomUUID().toString()));
    //        }
    //    }
    //    return "ok";
    //}
}
